package com.b2c.product.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
@Component
public class MetaTimeFillHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        fillStrategy(metaObject,"create_time", LocalDateTime.now());
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        fillStrategy(metaObject,"update_time", LocalDateTime.now());

    }
}
